package com.declum.archon.client;

public class RequestFactory implements RequestType {
	static RequestFactory	factory;

	public static RequestFactory getInstance() {
		if (RequestFactory.factory == null) {
			RequestFactory.factory = new RequestFactory();
		}
		return RequestFactory.factory;
	}

	public IRequest getRequestInstance(String type) {
		if (type.equals(RequestType.PING)) {
			return new PingRequest();
		} else if (type.equals(RequestType.CREATE_CHUNK)) {
			return new CreateChunkRequest();
		}
		return new FakeRequest();
	}
}
